/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.dao.impl;

import java.util.List;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import thienphuc.patient.dao.AbstractHibernateDaoSupport;
import thienphuc.patient.dao.DonViTinhDAO;
import thienphuc.patient.dto.DonViTinh;

/**
 *
 * @author QuocDat
 */
public class DonViTinhDAOImpl extends AbstractHibernateDaoSupport<DonViTinh, Integer> implements DonViTinhDAO {

    public DonViTinhDAOImpl(Class<DonViTinh> classPersistent) {
        super(classPersistent);
    }

    public List<DonViTinh> findByTenDonViTinh(String tenDonViTinh) throws Exception {
        Criterion criterionTenDonViTinh = Restrictions.like(DON_VI_TINH_TEN_DON_VI_TINH, "%" + tenDonViTinh + "%");
        return this.findByCriteria(criterionTenDonViTinh);
    }
}
